package com.jml.jdk;

import com.jml.entity.UserEntity;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;


public class JdkMapperProxy implements InvocationHandler {

    /**
     * 目标对象
     */
    private Object target;

    public JdkMapperProxy(Object target) {
        this.target = target;
    }


//    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
//        System.out.println("-----------------");
//        Object invoke = method.invoke(target, args);
//        System.out.println("++++++++++++++++");
//        return invoke;
//        //return new UserEntity(1l, "jml", 21);
//    }


    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        for (int i = 0; i < args.length; i++) {
            System.out.println(args[i]+"---------+++++++");
        }
        return null;
        //return new UserEntity(1l, "jml", 21);
    }


}
